export const KEY = 'VISIBLE_COM'

export const setItem = (key, value) => {
    if (typeof value === 'object') {
        value = JSON.stringify(value)
    }
    window.localStorage.setItem(key, value)
}

// 2.获取数据
export const getItem = (key) => {
    const value = window.localStorage.getItem(key)
    try {
        return JSON.parse(value)
    } catch (err) {
        return value
    }
}
